refactor: extract microflow anchor selection helpers#325
Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Open
refactor: extract microflow anchor selection helpers#325hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Conversation
Symptom: microflow builder code duplicated the same pending-anchor and branch-destination selection logic in multiple flow construction paths. Root cause: each call site expanded the precedence checks inline, making follow-up handler and branch fixes harder to review independently. Fix: add branchDestinationAnchor and pendingFlowAnchors helpers, then route the existing graph and IF first-branch call sites through them while preserving the current origin/main anchor precedence. Tests: make build and make test both pass. This is a no-behaviour-change refactor; behaviour-changing branch-anchor precedence fixes stay in downstream audit branches.
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove. The refactor improves code maintainability with zero behavior risk, follows the project's atomic commit principles, and has been thoroughly validated. No changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
36 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #332.
Closes #324.
Summary
Extracts duplicated microflow builder anchor selection logic into two helpers. This is a no-behavior-change refactor intended to make follow-up anchor/handler fixes smaller and easier to review.
Root cause
Several builder paths repeated the same precedence checks inline for pending anchors, branch anchors, and statement anchors.
Refactor
branchDestinationAnchor.pendingFlowAnchors.Behavior
No behavior change intended. Behavior-changing fixes remain in separate branches.
Tests
No new behavior tests added because this only extracts existing logic. Existing tests cover the affected paths.
Validation
make buildmake testmake lint-gomake test-integrationAgentic Code Testing
Test plan